package com.netty.esc.common.enums;

/**
 * @Author: Etan96
 * @CreateDate: 2022/8/25 23:05
 * @Description:
 */
public enum RobotTypeEM {
    ASSISTANT("小助手", "008"),
    PUSH("推送机器人", "001"),
    CRAWLER("微群爬虫机器人", "002"),
    TKL("口令转换机器人", "003"),
    THIEF("偷客机器人", "004"),

    UNKNOWN("未知机器人", "000");

    private final String desc;
    private final String type;

    RobotTypeEM(String desc, String type) {
        this.desc = desc;
        this.type = type;
    }

    public String desc() {
        return desc;
    }

    public String type() {
        return type;
    }

    /*
     * 匹配操作码
     * */
    public static RobotTypeEM matchType(String type) {
        for (RobotTypeEM protocolType : RobotTypeEM.values()) {
            if (protocolType.type().equals(type)) {
                return protocolType;
            }
        }
        return RobotTypeEM.UNKNOWN;
    }
}
